<template>
  <div class="my_input">
    <input
      :type="inputType"
      :value="modelValue"
      @input="$emit('update:modelValue', $event.target.value)"
      :placeholder="placeholder"
      @blur="$emit('blur')"
    />
    <div class="input-rt">
      <slot></slot>
    </div>
  </div>
</template>

<script>
import { ref, reactive, toRefs } from "vue";
export default {
  props: {
    modelValue: {
      type: [String, Number],
    },
    placeholder: {
      type: String,
      default: "请输入内容",
    },
    inputType:{
      type: String,
      default: 'text'
    }
  },
  setup() {},
  // directives:{ // 局部的自定义指令
  //   focus:{
  //     mounted(el,binding){
  //       console.log(el);
  //       el.focus();
  //     }
  //   }
  // }
};
</script>
<style lang="scss" scoped>
.my_input {
  height: 48px;
  display: flex;
  width: 273px;
  background: #f5f5f5;
  align-items: center;
  padding: 0 10px;
  box-sizing: border-box;
  border-radius: 5px;
  margin-top: 25px;
  border: 1px solid transparent;
  input {
    border: none;
    height: 28px;
    width: 70%;
    background: transparent;
    font-size: 13px;
  }
  .input-rt {
    display: inline-flex;
    align-items: center;
    margin-left: auto;
  }
}
</style>